package com.offcn.domain;

import java.util.List;

public class PageProduct {
    private List<Product> list;//分页商品信息
    private int pageSize = 2;//每页条数
    private int pageNumber;//当前页
    private int totalPage;//总页数
    private int totalCount;//总条数
    private int prePage;//上一页
    private int nextPage;//下一页
    private int begin;//开始页
    private int end;//结束页

    public List<Product> getList() {
        return list;
    }

    public void setList(List<Product> list) {
        this.list = list;
    }

    public int getPageSize() {
        return pageSize;
    }

    public int getPageNumber() {
        return pageNumber;
    }

    public void setPageNumber(int pageNumber) {
        this.pageNumber = pageNumber;
    }

    public int getTotalPage() {
        return totalPage;
    }

    public int getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(int totalCount) {
        this.totalCount = totalCount;
        //总页数
        this.totalPage = totalCount%pageSize==0?(totalCount/pageSize):(totalCount/pageSize+1);
        //上一页
        this.prePage = pageNumber==1?pageNumber:pageNumber-1;
        //下一页
        this.nextPage = pageNumber==totalPage?pageNumber:pageNumber+1;
    }

    public int getPrePage() {
        return prePage;
    }
    public int getNextPage() {
        return nextPage;
    }

    public int getBegin() {
        return begin;
    }

    public void setBegin(int begin) {
        this.begin = begin;
    }

    public int getEnd() {
        return end;
    }

    public void setEnd(int end) {
        this.end = end;
    }
}
